package cn.bird.storm.sysauth.controller;

import cn.bird.storm.component.jackson.response.ResponseResult;
import cn.bird.storm.component.log.WebLog;
import cn.bird.storm.sysauth.model.dto.SysUserDTO;
import cn.bird.storm.sysauth.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统用户控制
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/sys/user")
public class UserController {

    private final UserService userService;

    /**
     * 保存用户
     */
    @WebLog(value = "保存用户")
    @PostMapping(value = "/save", name = "保存用户")
    public ResponseResult<String> saveUser(@RequestBody SysUserDTO sysUserDTO) {
        userService.saveUser(sysUserDTO);
        return null;
    }

}
